package ar.com.ford.it.fullEconomics.logic;

import ar.com.ford.it.fullEconomics.FullEconomicsPrs;
import ar.com.ford.it.fullEconomics.exception.FullEconomicsException;
import ar.com.ford.it.fullEconomics.persistence.dao.PlantcatalDao;
import ar.com.ford.it.fullEconomics.persistence.dto.Ncas101PlntcatVw;
import com.ford.it.logging.ILogger;
import com.ford.it.logging.Level;
import com.ford.it.logging.LogFactory;
import com.ford.it.persistence.PersistenceException;

public class PlantcatalLogic {
    private static final String CLASS_NAME = PlantcatalLogic.class
            .getName();
    private static final ILogger log = LogFactory.getInstance().getLogger(
            CLASS_NAME);

    public Ncas101PlntcatVw getPlantByIdLogic(Ncas101PlntcatVw plantcatal) throws FullEconomicsException{
        String METHOD_NAME = "getPlantByIdLogic";
        log.entering(CLASS_NAME, METHOD_NAME);
        Ncas101PlntcatVw res=null;
        PlantcatalDao dao = new PlantcatalDao();
        
        try {
            res = dao.getPlantcatalById(plantcatal);
        } catch (PersistenceException e) {
            log.logp(Level.SEVERE, CLASS_NAME, METHOD_NAME,
                    "Find all Color Exception", e);
            throw new FullEconomicsException(e,
                    FullEconomicsPrs.MessageErrors.Plantcatal.GETBYID);
        }
        log.entering(CLASS_NAME, METHOD_NAME);
        return res;
    }
}
